package com.zykj.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author zhoulj(周利军) [1217102780@qq.com]
 * @Title: ZaocanMenum
 * @Project: ${MODEL_NAME}
 * @Module ID:   <(模块)类编号，可以引用系统设计中的类编号>
 * @Comments: <对此类的描述，可以引用系统设计中的描述>
 * @JDK version used:      <JDK1.8> 13
 * @since 2019/1/7-21:13
 */
public class WucanMenum implements Menu {
    MenuItem[] menuItems;
    static final int MAX_ITEMS = 6;
    private int offset = 0 ;
    public WucanMenum() {
        menuItems = new MenuItem[MAX_ITEMS];
        addItem("炒菜1", "炒菜1..", false, 12.5);
        addItem("炒素菜", "炒素菜..", true, 8.5);
        addItem("炒鸡蛋", "炒鸡蛋..", false, 8.5);
        addItem("菜汤", "菜汤..", true, 4.5);
    }
    public void addItem(String name, String descrption, boolean vege, double price) {
        MenuItem menuItem = new MenuItem(name, descrption, vege, price);
        menuItems[offset] = menuItem;
        offset=offset+1;
    }

    @Override
    public Iterator createIterator() {
        return new WucanIterator(menuItems);
    }
}
